//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package commands;

import common.ByteStream;

public class BuyAnimal extends LogicCommand {
    private final Integer animalId;
    private final Integer habitatId;
    private final Integer x;
    private final Integer y;
    private final boolean mirrored;

    public BuyAnimal(int tt, int animalId, int habitatId, int x, int y, boolean mirrored) {
        super(tt);
        this.animalId = Integer.valueOf(animalId);
        this.habitatId = Integer.valueOf(habitatId);
        this.x = Integer.valueOf(x);
        this.y = Integer.valueOf(y);
        this.mirrored = mirrored;
    }

    public int getCommandId() {
        return 5;
    }

    public void encode(ByteStream stream) {
        stream.writeInt(this.getCommandId());
        stream.writeInt(this.animalId.intValue());
        stream.writeInt(this.x.intValue());
        stream.writeInt(this.y.intValue());
        stream.writeInt(this.habitatId.intValue());
        stream.writeBoolean(this.mirrored);
        stream.writeInt(this.ticksWhenTouch().intValue());
    }
}
